/** Created by CUIJA on 05-19-2017.*/


FoodAdService.$inject = ['$http'];
function FoodAdService($http) {

  var fasc = this;

   function  foodAdlist(icnum,callback){
     var request = {
                method: 'GET',
                url: '/m/foodAd/getFoodAdByMerchant/'+icnum  
            };

            return $http(request).then(function(res, status, headers) {
              console.log(res.data);
                callback(null, res.data);
            });
   }

   function getPassedFoodAdList(icnum,callback){
     var request = {
                method: 'GET',
                url: '/m/foodAd/getPassedFoodAd/'+icnum  
            };

            return $http(request).then(function(res, status, headers) {
              console.log(res.data);
                callback(null, res.data);
            });
   }

   function getUnpassedFoodAdList(icnum,callback){
     var request = {
                method: 'GET',
                url: '/m/foodAd/getUnpassedFoodAd/'+icnum  
            };

            return $http(request).then(function(res, status, headers) {
              console.log(res.data);
                callback(null, res.data);
            });       
   }   


  return {
      foodAdlist: foodAdlist,
      getPassedFoodAdList : getPassedFoodAdList,
      getUnpassedFoodAdList : getUnpassedFoodAdList,

  };
}


module.exports = FoodAdService;